import os
import shutil

def delete_third_level_folders(root_dir):
    # 递归遍历目录树
    for root, dirs, files in os.walk(root_dir):
        # 计算当前目录的深度
        level = root.replace(root_dir, '').count(os.sep)
        
        # 如果当前目录的深度为3，则删除它
        if level == 2:
            shutil.rmtree(root)
            print(f"Deleted directory: {root}")

# 调用函数，传入你想要删除第三层子目录的根目录路径
root_directory = 'E:\\小象第二批\\zhungeer2.7z\\准格尔金诚2\\长银'
delete_third_level_folders(root_directory)
